<?php
namespace Apps\BoxSns\Model;

use Think\Model;

class SnsNotificationModel extends \BaseModel
{
    /*****增加一个提醒****/
    function send($user_id, $content, $url)
    {
        //	$this->trueTableName=$this->make_table($this->part_table($user_id));
        $row = array(
            'user_id' => $user_id,
            'content' => $content,
            'url' => $url,
            'addtime' => time(),
        );
        $id = $this->add($row);
        if ($id) {
            hook("notification_after_add", $row);
        }
        return $id;
    }

    /*******提醒列表******/
    function getlist($user_id, $limit, $order = "state , addtime desc")
    {
        //$this->trueTableName="system_log_".$this->part_table($user_id);
        $where = "user_id='$user_id'";
								//dump($order);
        $data = $this->get($where, $limit, $order);
        return $data;
    }


}
 